package edu.cmu.cs.erl.pltests;

import org.junit.Test;

import jp.ac.kobe_u.cs.prolog.lang.IntegerTerm;
import jp.ac.kobe_u.cs.prolog.lang.JavaObjectTerm;
import jp.ac.kobe_u.cs.prolog.lang.Predicate;
import jp.ac.kobe_u.cs.prolog.lang.PrologControl;
import jp.ac.kobe_u.cs.prolog.lang.Term;
import jp.ac.kobe_u.cs.prolog.lang.VariableTerm;
import edu.cmu.cs.erl.rules.PRED_intToStringTest_2;

public class IntToStringTest {
	@Test
	public void intToString() {
		PrologControl control = new PrologControl();
		Predicate pred = new PRED_intToStringTest_2();
				
		VariableTerm returnValue = new VariableTerm();
		Term[] termArgs = new Term[]{new IntegerTerm(8), returnValue};
		

		if (control.execute(pred, termArgs)) {
			JavaObjectTerm object = (JavaObjectTerm) returnValue.dereference();
			System.out.println("Got back a " + object.object().toString());
		}
		else{
			System.out.println("Failed");
		}

	}
}